package com.ctbri.io;

import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.List;

public class Ex13 {

	static String file = "Ex13.out";
	public static void main(String[] args) throws IOException {
	
		LineNumberReader in = new LineNumberReader(new FileReader("C:/HPDIU.log"));
		List<String> lines = new LinkedList<>();
		String s;
		while((s = in.readLine()) != null) {
			lines.add(in.getLineNumber() + ": " + s);
		}
		in.close();
		
		PrintWriter out = new PrintWriter(file);
		for(String line : lines) {
			out.println(line);
		}
		out.close();
	}

}
